import { defineStore } from "pinia";
import { store } from "@/store";

export const useAssetsStore = defineStore({
  id: "assets",
  state: () => ({
    allAssets: []
  }),
  getters: {
    getAllAssets(state) {
      return state.allAssets;
    }
  },
  actions: {
    SET_ALL_ASSETS(assets) {
      this.allAssets = Array.isArray(assets) ? assets : [];
    }
  }
});

export function useAssetsStoreHook() {
  return useAssetsStore(store);
}
